<?php 
require_once ROOT_PATH . '/lib/models/hrfunct/EmpInfo.php';
$empList = EmpInfo::getEmpInfo();
?>
<h2><?php echo "Skill Matrix"; ?><hr/></h2>
<form id="frmCancelLeave" name="frmCancelLeave" method="post" action="">
<table border="0" cellpadding="0" cellspacing="0">
   <thead>
  	<tr>
		<th class="tableTopLeft"></th>    	
    	<th class="tableTopMiddle" ></th>
    	<th class="tableTopMiddle" ></th>
    		<? for($i=0; $i<count($empList);$i++){ ?>
    			<th class="tableTopMiddle" ></th>
		<?php } ?>                	
		<th class="tableTopRight"></th>
	</tr>
	<tr>
		<th class="tableMiddleLeft"></th>		
    	<th class="tableMiddleMiddle" ><?php echo "Group"; ?></th>
    	<th class="tableMiddleMiddle" ><?php echo "Skill Expertise"; ?></th>
    		<? for($i=0; $i<count($empList);$i++){ ?>
    			<th class="tableMiddleMiddle" >
    				<table>
    					<tr>
    						<td colspan="4"><?php echo $empList[$i][1]." ".$empList[$i][4]." ".$empList[$i][3]; ?></td>
    					</tr>
    					<tr>
    						<td>&lt;1</td>
    						<td>1-3</td>
    						<td>3-5</td>
    						<td>5&lt;</td>    						
    					</tr>
    					
    				</table>
    			</th>
		<?php } ?>
		
		<th class="tableMiddleRight"></th>
	</tr>
  </thead>
  <tbody>
  
<?php
	$j = 0;
	if (is_array($records) && count($records)>0) {		
		foreach ($records as $record) {
			//$surveyOwner = 
			if(!($j%2)) {
				$cssClass = 'odd';
			 } else {
			 	$cssClass = 'even';
			 }
			 $j++;			 
?> 
		<tr>
		  	<td class="tableMiddleLeft"></td>
		    <td class="<?php echo $cssClass; ?>"><a href="CentralController.php?skillMatrixcode=SkillMatrix&action=GroupDetail&id=<?php echo $record->getId(); ?>" target="rightMenu"><?php echo $record->getSkillGroupName(); ?></a></td>
		    <td class="<?php echo $cssClass; ?>">
		    	<table>
		    		<?php
		    			$skillExpertises = $record->getSkillExpertise($record->getId()); 
		    			if(count($skillExpertises)>0){
		    				foreach($skillExpertises as $skillExpertise){ ?>
		    					<tr>		    						
		    						<td><a href="CentralController.php?skillMatrixcode=SkillMatrix&action=GroupDetail&id=<?php echo $record->getId(); ?>" target="rightMenu"><?php echo $skillExpertise->getSkillExpertiseName(); ?></a></td>		    						    						
		    					</tr>
		    				<?php }
		    			} 
		    		?>
		    	</table>	
		    </td>
		<? for($i=0; $i<count($empList);$i++){ ?>
    	<td class="<?php echo $cssClass; ?>">
    		<table>
		    		<?php
		    			$skillExpertises = $record->getSkillExpertise($record->getId()); 
		    			if(count($skillExpertises)>0){
		    				foreach($skillExpertises as $skillExpertise){ ?>
		    					<tr>		    						
		    						<td>
		    							<?php echo $skillExpertise->getUserSkills($skillExpertise->getId(),$empList[$i][0])?1:0 ;  ?>
		    						</td>
		    						<td>
		    							<?php echo $skillExpertise->getUserSkills($skillExpertise->getId(),$empList[$i][0])?1:0 ;  ?>
		    						</td>	
		    						<td>
		    							<?php echo $skillExpertise->getUserSkills($skillExpertise->getId(),$empList[$i][0])?1:0 ;  ?>
		    						</td>	
		    						<td>
		    							<?php echo $skillExpertise->getUserSkills($skillExpertise->getId(),$empList[$i][0])?1:0 ;  ?>
		    						</td>	
		    									    						    						
		    					</tr>
		    				<?php }
		    			} 
		    		?>
		    	</table>	
    	</td>
		<?php } ?> 
			<td class="tableMiddleRight"></td>
 		 </tr>
		
	<?php }
	}
?>
  </tbody>
  <tfoot>
  	<tr>
		<td class="tableBottomLeft"></td>
		<td class="tableBottomMiddle"></td>
		<td class="tableBottomMiddle"></td>	
			<? for($i=0; $i<count($empList);$i++){ ?>
    			 	<td class="tableBottomMiddle"></td>	
		<?php } ?>				
		<td class="tableBottomRight"></td>
	</tr>
  </tfoot>
</table>

